#pragma once

#include <iostream>
using namespace std;
#include <string>
#include"protocol.hpp"

const string sep = "\r\n";
class util
{
public:
    // 按行获取
    static string getOneline(string &buffer)
    {
        auto pos = buffer.find(sep);
        if(pos == string::npos) return "";
        string sub = buffer.substr(0,pos);
        buffer.erase(0,sub.size()+sep.size());//拿走一个行数据，就删除
        return sub;
    }
};